﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PhotoManagerApp.ViewModels;
using System.IO;

namespace VisitorsApp.Views
{
    public partial class UploadPhotoWindow : ChildWindow
    {
        private ProfileViewModel viewModel;
        public UploadPhotoWindow(ProfileViewModel viewModel)
        {
            InitializeComponent();
            this.viewModel = viewModel;
            this.DataContext = this.viewModel;
        }

        public void ButtonBrowse_Click(object sender, RoutedEventArgs e)
        {
            this.viewModel.UploadPhoto();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.viewModel.AddPhoto();
            this.Close();
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            viewModel.NewImage = new PhotoManagerApp.Web.EF.Image();
            this.Close();
        }
    }
}

